package com.labot.service.impl;

import java.util.Date;
import java.util.List;

import javax.jws.WebService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.labot.dao.AuditDao;
import com.labot.model.audit.Audit;
import com.labot.service.AuditManager;
import com.labot.types.AuditEventType;
import com.labot.types.AuditType;


/**
 * Implementation of UserManager interface.
 * 
 * @author Ing. Enrique Barbeito.
 * 
 */
@Service("auditManager")
@WebService(serviceName = "AuditService", endpointInterface = "com.labot.service.AuditService")
public class AuditManagerImpl extends GenericManagerImpl<Audit, Long> implements AuditManager {

	private AuditDao auditDao;
	
	@Autowired
	public void setAuditDao(AuditDao a) {
		 this.dao = a;
		 this.auditDao = a;
	}

	@Override
	public List<Audit> getBy(AuditEventType event, AuditType type,
			String executionPlace, String userName, String raw, Date from,
			Date to) {
		return auditDao.getBy(event, type, executionPlace, userName, raw, from, to);
	}

	@Override
	public List<Audit> getBy(String event, String type, String executionPlace,
			String userName, String raw, Date from, Date to) {
		return auditDao.getBy(event, type, executionPlace, userName, raw, from, to);
	}

	@Override
	public Audit log(AuditEventType event, AuditType auditType,
			String className, String userName, String raw) {
		return auditDao.log(event, auditType, className, userName, raw);
	}

	
    
}
